import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
// import Cookie from "js-cookie";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home
  },
  {
    path: "/login",
    name: "Login",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Login.vue"),
  },
  {
    path: '/reset',
        name: 'Reset',
        //当用户访问对应的组件时，才会调用回调函数加载该组件
        //懒加载导入模块1
        component: () => import("../views/Reset.vue"),
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
